#FILE: makefile
#author:wuliangyu
#description: makefile for demo
#datetime:201110

CC = gcc
AR = ar
AROPTS= crv
OBJS = thread_pool.o easy_sock.o mlog.o mfile.o
DEMOLIBS = $(LIBSDIR)/libdemo.a
TRAGET = $(BINDIR)/demo
DEMODIR = ..
LIBSDIR = $(DEMODIR)/lib
BINDIR = $(DEMODIR)/bin
INCLUDEDIR = $(DEMODIR)/include
CFLAGS = -I$(INCLUDEDIR) -L$(LIBSDIR) 

all: $(DEMOLIBS)
	$(CC) $(CFLAGS) demo.c -o $(BINDIR)/demo -lpthread -ldemo


$(DEMOLIBS): $(OBJS)
	$(AR) $(AROPTS) $@ $^

$(OBJS):

%.o:%.c
	$(CC) -c $(CFLAGS) $< -o $@

clean:
	rm -f $(OBJS) $(DEMOLIBS) $(TRAGET)
